﻿/*******************************************************************************
 * Copyright © 2017 FriendStar.Framework 版权所有
 * Author: HYF
 * Description: FriendStar快速开发平台
 * Website：http://www.FriendStar.cn
*********************************************************************************/
using FriendStar.Domain.Entity.WareHouse;
using FriendStar.Domain.IRepository.WareHouse;
using FriendStar.Repository.WareHouse;
using System;
using System.Collections.Generic;
using System.Linq;
using SqlSugarRepository;

namespace FriendStar.Application.WareHouse
{
    public class CPK_42_MX_StoCPKListAccoApp
    {
        private ICPK_42_MX_StoCPKListAccoRepository service = new CPK_42_MX_StoCPKListAccoRepository();

        public List<CPK_42_MX_StoCPKListAccoEntity> GetList()
        {
            return service.IQueryable().ToList();
        }
        public CPK_42_MX_StoCPKListAccoEntity GetForm(string keyValue)
        {
            return service.FindEntity(keyValue);
        }
        public void DeleteForm(string keyValue)
        {
            service.Delete(p => p.FDocuListID == keyValue);
        }
        public void SubmitForm(CPK_42_MX_StoCPKListAccoEntity CPK_42_MX_StoCPKListAccoEntity, string keyValue)
        {
            if (!string.IsNullOrEmpty(keyValue))
            {
                service.Update(CPK_42_MX_StoCPKListAccoEntity);
            }
            else
            {
                service.Insert(CPK_42_MX_StoCPKListAccoEntity);
            }
        }

    }
}
